﻿<UserControl x:Class="ViewsAndViewModels.Views.MainContentView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             Background="Thistle"
            >
    <Grid Margin="3" >
            <DockPanel LastChildFill="False" Background="AliceBlue" >
                <DockPanel.Resources>
                    <Style TargetType="TextBlock">
                        <Setter Property="Width" Value="80"/>
                        <Setter Property="VerticalAlignment" Value="Center"/>
                    </Style>
                    <Style TargetType="StackPanel">
                        <Setter Property="Margin" Value="3,3,3,3"/>
                    </Style>
                </DockPanel.Resources>
                <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
                    <TextBlock Text="Length" Width="50"></TextBlock>
                    <TextBox Width="30" IsReadOnly="True" Text="{Binding ElementName=PasswordLengthSlider, Path=Value}" HorizontalAlignment="Right" VerticalAlignment="Center" />
                <Slider Name="PasswordLengthSlider" 
                        Width="200" 
                        Minimum="4" 
                        Maximum="12" 
                        Value="{Binding PasswordLength, UpdateSourceTrigger=PropertyChanged}"
                        ToolTip="How many characters do you want in the password?"
                        />
                </StackPanel>
            <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
                <TextBlock Text="Letters"></TextBlock>
                <CheckBox Content="Left hand" 
                          IsChecked="{Binding IsLeftHandChecked, UpdateSourceTrigger=PropertyChanged}"
                          ToolTip="Use keys on the left side of the keyboard?"
                          Foreground="Teal"
                          />
                <Rectangle Width="20"/>
                <CheckBox Content="Right hand" 
                          IsChecked="{Binding IsRightHandChecked, UpdateSourceTrigger=PropertyChanged}"
                          ToolTip="Use keys on the right side of the keyboard?"
                          Foreground="Teal"
                          />
            </StackPanel>
            <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
                <TextBlock Text="Options"/>
                <CheckBox Content="Include symbols" 
                          IsChecked="{Binding IsIncludeSymbolsChecked, UpdateSourceTrigger=PropertyChanged}"
                          ToolTip="Include symbols (such as !+*%) in your password?"
                          Foreground="Teal"
                          />
            </StackPanel>
            <Rectangle Height="20" DockPanel.Dock="Top"/>
            <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
                
                <TextBlock Text="{Binding ErrorText}" Foreground="Red" Width="400" FontWeight="Bold"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
                <TextBlock Text="Result"/>
                <TextBox Background="Navy" 
                         Foreground="White" 
                         FontWeight="Bold"
                         IsReadOnly="True" 
                         Width="200" 
                         HorizontalAlignment="Left" 
                         VerticalAlignment="Center" 
                         Text="{Binding ComputedPassword, UpdateSourceTrigger=PropertyChanged}"
                         ToolTip="Your password"
                         />
            </StackPanel>
            <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
                <TextBlock Text="Actions"/>
                <Button 
                    Width="100"
                    Margin="10,0,0,0"
                    Content="Regenerate"        
                    Command="{Binding RegenerateCommand}" 
                    ToolTip="Regenerate the password"/>
                <Button 
                    Width="100"
                    Margin="10,0,0,0"
                    Content="Copy to clipboard" 
                    Command="{Binding CopyToClipboardCommand}" 
                    ToolTip="Copy the password to your clipboard"/>
                <Button 
                    Width="100"
                    Margin="10,0,0,0"
                    Content="Save to file"      
                    Command="{Binding SaveToFileCommand}" 
                    ToolTip="Save the password in a text file"/>
            </StackPanel>
        </DockPanel>
    </Grid>
</UserControl>
